home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / nemesis.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  72KB  |  2,024 lines

  1. /***************************************************************************
  2.  
  3.     Nemesis (Hacked?)        GX400
  4.     Nemesis (World?)        GX400
  5.     Twin Bee                GX412
  6.     Gradius                    GX456
  7.     Galactic Warriors        GX578
  8.     Konami GT                GX561
  9.     RF2                        GX561
  10.     Salamander                GX587
  11.     Lifeforce (US)            GX587
  12.     Lifeforce (Japan)        GX587
  13.  
  14. driver by Bryan McPhail
  15.  
  16. ***************************************************************************/
  17.  
  18. #include "driver.h"
  19. #include "vidhrdw/generic.h"
  20. #include "cpu/z80/z80.h"
  21.  
  22. static unsigned char *ram;
  23. static unsigned char *ram2;
  24.  
  25. extern unsigned char *nemesis_videoram1;
  26. extern unsigned char *nemesis_videoram2;
  27. extern unsigned char *nemesis_characterram;
  28. extern unsigned char *nemesis_xscroll1,*nemesis_xscroll2, *nemesis_yscroll;
  29. extern size_t nemesis_characterram_size;
  30.  
  31. READ_HANDLER( nemesis_videoram1_r );
  32. WRITE_HANDLER( nemesis_videoram1_w );
  33. READ_HANDLER( nemesis_videoram2_r );
  34. WRITE_HANDLER( nemesis_videoram2_w );
  35. READ_HANDLER( nemesis_characterram_r );
  36. WRITE_HANDLER( nemesis_characterram_w );
  37. void nemesis_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  38. int  nemesis_vh_start(void);
  39. void nemesis_vh_stop(void);
  40.  
  41. void twinbee_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  42. void salamand_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  43. void nemesis_init_machine(void);
  44.  
  45. WRITE_HANDLER( salamander_palette_w );
  46.  
  47.  
  48. WRITE_HANDLER( gx400_xscroll1_w );
  49. WRITE_HANDLER( gx400_xscroll2_w );
  50. WRITE_HANDLER( gx400_yscroll_w );
  51. READ_HANDLER( gx400_xscroll1_r );
  52. READ_HANDLER( gx400_xscroll2_r );
  53. READ_HANDLER( gx400_yscroll_r );
  54.  
  55. extern unsigned char *nemesis_yscroll1, *nemesis_yscroll2;
  56.  
  57.  
  58. WRITE_HANDLER( nemesis_palette_w );
  59.  
  60. int irq_on = 0;
  61. int irq1_on = 0;
  62. int irq2_on = 0;
  63. int irq4_on = 0;
  64.  
  65.  
  66. void nemesis_init_machine(void)
  67. {
  68.     irq_on = 0;
  69.     irq1_on = 0;
  70.     irq2_on = 0;
  71.     irq4_on = 0;
  72. }
  73.  
  74.  
  75.  
  76. int nemesis_interrupt(void)
  77. {
  78.     if (irq_on) return 1;
  79.  
  80.     return 0;
  81. }
  82.  
  83. WRITE_HANDLER( salamand_soundlatch_w )
  84. {
  85.     soundlatch_w(offset,data & 0xff);
  86.     cpu_cause_interrupt(1,Z80_IRQ_INT);
  87.  
  88. //logerror("z80 data write\n");
  89.  
  90. //cpu_cause_interrupt(1,Z80_NMI_INT);
  91. }
  92. int konamigt_interrupt(void)
  93. {
  94.     if (cpu_getiloops() == 0)
  95.     {
  96.         if (irq_on)    return 1;
  97.     }
  98.     else
  99.     {
  100.         if (irq2_on) return 2;
  101.     }
  102.  
  103.     return 0;
  104. }
  105.  
  106. int gx400_interrupt(void)
  107. {
  108.     switch (cpu_getiloops())
  109.     {
  110.         case 0:
  111.             if (irq1_on) return 1;
  112.             break;
  113.  
  114.         case 1:
  115.             if (irq2_on) return 2;
  116.             break;
  117.  
  118.         case 2:
  119.             if (irq4_on) return 4;
  120.             break;
  121.     }
  122.  
  123.     return 0;
  124. }
  125.  
  126. WRITE_HANDLER( gx400_irq1_enable_w )
  127. {
  128.     if ((data & 0x00ff0000) == 0)
  129.         irq1_on = data & 0x0001;
  130. /*    else
  131. logerror("irq1en = %08x\n",data);*/
  132. }
  133.  
  134. WRITE_HANDLER( gx400_irq2_enable_w )
  135. {
  136.     if ((data & 0x00ff0000) == 0)
  137.         irq2_on = data & 0x0001;
  138. /*    else
  139. logerror("irq2en = %08x\n",data);*/
  140. }
  141.  
  142. WRITE_HANDLER( gx400_irq4_enable_w )
  143. {
  144.     if ((data & 0xff000000) == 0)
  145.         irq4_on = data & 0x0100;
  146. /*    else
  147. logerror("irq4en = %08x\n",data);*/
  148. }
  149.  
  150. static unsigned char *gx400_shared_ram;
  151.  
  152.  
  153. READ_HANDLER( gx400_sharedram_nosoundfix_r )
  154. {
  155.     return 2;
  156. }
  157.  
  158. READ_HANDLER( gx400_sharedram_r )
  159. {
  160.     return gx400_shared_ram[offset / 2];
  161. }
  162.  
  163. WRITE_HANDLER( gx400_sharedram_w )
  164. {
  165.     gx400_shared_ram[offset / 2] = data;
  166. }
  167.  
  168.  
  169.  
  170. int salamand_interrupt(void)
  171. {
  172.     if (irq_on)
  173.         return(1);
  174.     else
  175.         return(0);
  176. }
  177.  
  178. WRITE_HANDLER( nemesis_irq_enable_w )
  179. {
  180.     irq_on = data & 0xff;
  181. }
  182.  
  183. WRITE_HANDLER( konamigt_irq_enable_w )
  184. {
  185.     if ((data & 0x00ff0000) == 0)
  186.     {
  187.         irq_on = data & 0xff;
  188.     }
  189. }
  190. WRITE_HANDLER( konamigt_irq2_enable_w )
  191. {
  192.     if ((data & 0x00ff0000) == 0)
  193.     {
  194.         irq2_on = data & 0xff;
  195.     }
  196. }
  197.  
  198. READ_HANDLER( konamigt_input_r )
  199. {
  200.     int data=readinputport(1);
  201.     int data2=readinputport(6);
  202.  
  203.     int ret=0;
  204.  
  205.     if(data&0x10) ret|=0x0800;            // turbo/gear?
  206.     if(data&0x80) ret|=0x0400;            // turbo?
  207.     if(data&0x20) ret|=0x0300;            // brake        (0-3)
  208.  
  209.     if(data&0x40) ret|=0xf000;            // accel        (0-f)
  210.  
  211.     ret|=data2&0x7f;                    // steering wheel, not exactly sure if DIAL works ok.
  212.  
  213.     return ret;
  214. }
  215.  
  216. WRITE_HANDLER( nemesis_soundlatch_w )
  217. {
  218.     soundlatch_w(offset,data & 0xff);
  219.  
  220.     /* the IRQ should probably be generated by 5e004, but we'll handle it here for now */
  221.     cpu_cause_interrupt(1,0xff);
  222. }
  223.  
  224. static struct MemoryReadAddress readmem[] =
  225. {
  226.     { 0x000000, 0x03ffff, MRA_ROM },
  227.     { 0x040000, 0x04ffff, nemesis_characterram_r },
  228.     { 0x050000, 0x0503ff, MRA_BANK1 },
  229.     { 0x050400, 0x0507ff, MRA_BANK2 },
  230.     { 0x050800, 0x050bff, MRA_BANK3 },
  231.     { 0x050c00, 0x050fff, MRA_BANK4 },
  232.  
  233.     { 0x052000, 0x053fff, nemesis_videoram1_r },
  234.     { 0x054000, 0x055fff, nemesis_videoram2_r },
  235.     { 0x056000, 0x056fff, MRA_BANK5 },
  236.     { 0x05a000, 0x05afff, paletteram_word_r },
  237.  
  238.     { 0x05c400, 0x05c401, input_port_4_r },    /* DSW0 */
  239.     { 0x05c402, 0x05c403, input_port_5_r },    /* DSW1 */
  240.  
  241.     { 0x05cc00, 0x05cc01, input_port_0_r },    /* IN0 */
  242.     { 0x05cc02, 0x05cc03, input_port_1_r },    /* IN1 */
  243.     { 0x05cc04, 0x05cc05, input_port_2_r },    /* IN2 */
  244.     { 0x05cc06, 0x05cc07, input_port_3_r },    /* TEST */
  245.  
  246.     { 0x060000, 0x067fff, MRA_BANK6 },
  247.     { -1 }  /* end of table */
  248. };
  249.  
  250. static struct MemoryWriteAddress writemem[] =
  251. {
  252.     { 0x000000, 0x03ffff, MWA_ROM },    /* ROM */
  253.  
  254.     { 0x040000, 0x04ffff, nemesis_characterram_w, &nemesis_characterram, &nemesis_characterram_size },
  255.  
  256.     { 0x050000, 0x0503ff, MWA_BANK1, &nemesis_xscroll1 },
  257.     { 0x050400, 0x0507ff, MWA_BANK2, &nemesis_xscroll2 },
  258.     { 0x050800, 0x050bff, MWA_BANK3 },
  259.     { 0x050c00, 0x050fff, MWA_BANK4, &nemesis_yscroll },
  260.     { 0x051000, 0x051fff, MWA_NOP },        /* used, but written to with 0's */
  261.  
  262.     { 0x052000, 0x053fff, nemesis_videoram1_w, &nemesis_videoram1 },    /* VRAM 1 */
  263.     { 0x054000, 0x055fff, nemesis_videoram2_w, &nemesis_videoram2 },    /* VRAM 2 */
  264.     { 0x056000, 0x056fff, MWA_BANK5, &spriteram, &spriteram_size },
  265.     { 0x05a000, 0x05afff, nemesis_palette_w, &paletteram },
  266.  
  267.     { 0x05c000, 0x05c001, nemesis_soundlatch_w },
  268.     { 0x05c800, 0x05c801, watchdog_reset_w },    /* probably */
  269.  
  270.     { 0x05e000, 0x05e001, &nemesis_irq_enable_w },    /* Nemesis */
  271.     { 0x05e002, 0x05e003, &nemesis_irq_enable_w },    /* Konami GT */
  272.     { 0x05e004, 0x05e005, MWA_NOP},    /* bit 8 of the word probably triggers IRQ on sound board */
  273.     { 0x060000, 0x067fff, MWA_BANK6, &ram },    /* WORK RAM */
  274.     { -1 }  /* end of table */
  275. };
  276.  
  277. WRITE_HANDLER( salamand_speech_start_w )
  278. {
  279.         VLM5030_ST ( 1 );
  280.         VLM5030_ST ( 0 );
  281. }
  282.  
  283. WRITE_HANDLER( gx400_speech_start_w )
  284. {
  285.         /* the voice data is not in a rom but in sound RAM at $8000 */
  286.         VLM5030_set_rom ((memory_region(REGION_CPU2))+ 0x8000);
  287.         VLM5030_ST (1);
  288.         VLM5030_ST (0);
  289. }
  290.  
  291. static READ_HANDLER( nemesis_portA_r )
  292. {
  293.     #define TIMER_RATE 1024
  294.  
  295.     return cpu_gettotalcycles() / TIMER_RATE;
  296. }
  297.  
  298. static struct MemoryReadAddress sound_readmem[] =
  299. {
  300.     { 0x0000, 0x3fff, MRA_ROM },
  301.     { 0x4000, 0x47ff, MRA_RAM },
  302.     { 0xe001, 0xe001, soundlatch_r },
  303.     { 0xe086, 0xe086, AY8910_read_port_0_r },
  304.     { 0xe205, 0xe205, AY8910_read_port_1_r },
  305.     { -1 }  /* end of table */
  306. };
  307.  
  308. static struct MemoryWriteAddress sound_writemem[] =
  309. {
  310.     { 0x0000, 0x3fff, MWA_ROM },
  311.     { 0x4000, 0x47ff, MWA_RAM },
  312.     { 0xa000, 0xafff, k005289_pitch_A_w },
  313.     { 0xc000, 0xcfff, k005289_pitch_B_w },
  314.     { 0xe003, 0xe003, k005289_keylatch_A_w },
  315.     { 0xe004, 0xe004, k005289_keylatch_B_w },
  316.     { 0xe005, 0xe005, AY8910_control_port_1_w },
  317.     { 0xe006, 0xe006, AY8910_control_port_0_w },
  318.     { 0xe106, 0xe106, AY8910_write_port_0_w },
  319.     { 0xe405, 0xe405, AY8910_write_port_1_w },
  320.     { -1 }  /* end of table */
  321. };
  322.  
  323. static struct MemoryReadAddress konamigt_readmem[] =
  324. {
  325.     { 0x000000, 0x03ffff, MRA_ROM },
  326.     { 0x040000, 0x04ffff, nemesis_characterram_r },
  327.     { 0x050000, 0x0503ff, MRA_BANK1 },
  328.     { 0x050400, 0x0507ff, MRA_BANK2 },
  329.     { 0x050800, 0x050bff, MRA_BANK3 },
  330.     { 0x050c00, 0x050fff, MRA_BANK4 },
  331.  
  332.     { 0x052000, 0x053fff, nemesis_videoram1_r },
  333.     { 0x054000, 0x055fff, nemesis_videoram2_r },
  334.     { 0x056000, 0x056fff, MRA_BANK5 },
  335.     { 0x05a000, 0x05afff, paletteram_word_r },
  336.  
  337.     { 0x05c400, 0x05c401, input_port_4_r },    /* DSW0 */
  338.     { 0x05c402, 0x05c403, input_port_5_r },    /* DSW1 */
  339.  
  340.     { 0x05cc00, 0x05cc01, input_port_0_r },    /* IN0 */
  341.     { 0x05cc02, 0x05cc03, input_port_1_r },    /* IN1 */
  342.     { 0x05cc04, 0x05cc05, input_port_2_r },    /* IN2 */
  343.     { 0x05cc06, 0x05cc07, input_port_3_r },    /* TEST */
  344.  
  345.     { 0x060000, 0x067fff, MRA_BANK6 },
  346.     { 0x070000, 0x070001, konamigt_input_r },
  347.     { -1 }  /* end of table */
  348. };
  349.  
  350. static struct MemoryWriteAddress konamigt_writemem[] =
  351. {
  352.     { 0x000000, 0x03ffff, MWA_ROM },    /* ROM */
  353.  
  354.     { 0x040000, 0x04ffff, nemesis_characterram_w, &nemesis_characterram, &nemesis_characterram_size },
  355.  
  356.     { 0x050000, 0x0503ff, MWA_BANK1, &nemesis_xscroll1 },
  357.     { 0x050400, 0x0507ff, MWA_BANK2, &nemesis_xscroll2 },
  358.     { 0x050800, 0x050bff, MWA_BANK3 },
  359.     { 0x050c00, 0x050fff, MWA_BANK4, &nemesis_yscroll },
  360.     { 0x051000, 0x051fff, MWA_NOP },        /* used, but written to with 0's */
  361.  
  362.     { 0x052000, 0x053fff, nemesis_videoram1_w, &nemesis_videoram1 },    /* VRAM 1 */
  363.     { 0x054000, 0x055fff, nemesis_videoram2_w, &nemesis_videoram2 },    /* VRAM 2 */
  364.     { 0x056000, 0x056fff, MWA_BANK5, &spriteram, &spriteram_size },
  365.     { 0x05a000, 0x05afff, nemesis_palette_w, &paletteram },
  366.  
  367.     { 0x05c000, 0x05c001, nemesis_soundlatch_w },
  368.     { 0x05c800, 0x05c801, watchdog_reset_w },    /* probably */
  369.  
  370.     { 0x05e000, 0x05e001, &konamigt_irq2_enable_w },
  371.     { 0x05e002, 0x05e003, &konamigt_irq_enable_w },
  372.     { 0x05e004, 0x05e005, MWA_NOP},    /* bit 8 of the word probably triggers IRQ on sound board */
  373.     { 0x060000, 0x067fff, MWA_BANK6, &ram },    /* WORK RAM */
  374.     { -1 }  /* end of table */
  375. };
  376.  
  377.  
  378. static struct MemoryReadAddress gx400_readmem[] =
  379. {
  380.     { 0x000000, 0x00ffff, MRA_ROM },
  381.     { 0x010000, 0x01ffff, MRA_RAM },
  382.     { 0x020000, 0x0287ff, gx400_sharedram_r },
  383.     { 0x030000, 0x03ffff, nemesis_characterram_r },
  384.     { 0x050000, 0x0503ff, MRA_RAM },
  385.     { 0x050400, 0x0507ff, MRA_RAM },
  386.     { 0x050800, 0x050bff, MRA_RAM },
  387.     { 0x050c00, 0x050fff, MRA_RAM },
  388.     { 0x052000, 0x053fff, nemesis_videoram1_r },
  389.     { 0x054000, 0x055fff, nemesis_videoram2_r },
  390.     { 0x056000, 0x056fff, MRA_RAM },
  391.     { 0x057000, 0x057fff, MRA_RAM },
  392.     { 0x05a000, 0x05afff, paletteram_word_r },
  393.     { 0x05c402, 0x05c403, input_port_4_r },    /* DSW0 */
  394.     { 0x05c404, 0x05c405, input_port_5_r },    /* DSW1 */
  395.     { 0x05c406, 0x05c407, input_port_3_r },    /* TEST */
  396.     { 0x05cc00, 0x05cc01, input_port_0_r },    /* IN0 */
  397.     { 0x05cc02, 0x05cc03, input_port_1_r },    /* IN1 */
  398.     { 0x05cc04, 0x05cc05, input_port_2_r },    /* IN2 */
  399.     { 0x060000, 0x07ffff, MRA_RAM },
  400.     { 0x080000, 0x0cffff, MRA_ROM },
  401.     { -1 }  /* end of table */
  402. };
  403.  
  404. static struct MemoryWriteAddress gx400_writemem[] =
  405. {
  406.     { 0x000000, 0x00ffff, MWA_ROM },
  407.     { 0x010000, 0x01ffff, MWA_RAM , &ram },
  408.     { 0x020000, 0x0287ff, gx400_sharedram_w },
  409.     { 0x030000, 0x03ffff, nemesis_characterram_w, &nemesis_characterram, &nemesis_characterram_size },
  410.     { 0x050000, 0x0503ff, MWA_RAM, &nemesis_xscroll1 },
  411.     { 0x050400, 0x0507ff, MWA_RAM, &nemesis_xscroll2 },
  412.     { 0x050800, 0x050bff, MWA_RAM },
  413.     { 0x050c00, 0x050fff, MWA_RAM, &nemesis_yscroll },
  414.     { 0x051000, 0x051fff, MWA_NOP },        /* used, but written to with 0's */
  415.     { 0x052000, 0x053fff, nemesis_videoram1_w, &nemesis_videoram1 },    /* VRAM 1 */
  416.     { 0x054000, 0x055fff, nemesis_videoram2_w, &nemesis_videoram2 },    /* VRAM 2 */
  417.     { 0x056000, 0x056fff, MWA_RAM, &spriteram, &spriteram_size },
  418.     { 0x057000, 0x057fff, MWA_RAM},                                        /* needed for twinbee */
  419.     { 0x05a000, 0x05afff, nemesis_palette_w, &paletteram },
  420.     { 0x05c000, 0x05c001, nemesis_soundlatch_w },
  421.     { 0x05c800, 0x05c801, watchdog_reset_w },    /* probably */
  422.     { 0x05e000, 0x05e001, &gx400_irq2_enable_w },    /* ?? */
  423.     { 0x05e002, 0x05e003, &gx400_irq1_enable_w },    /* ?? */
  424.     { 0x05e004, 0x05e005, MWA_NOP},    /* bit 8 of the word probably triggers IRQ on sound board */
  425.     { 0x05e008, 0x05e009, MWA_NOP },    /* IRQ acknowledge??? */
  426.     { 0x05e00e, 0x05e00f, &gx400_irq4_enable_w },    /* ?? */
  427.     { 0x060000, 0x07ffff, MWA_RAM , &ram2},
  428.     { 0x080000, 0x0cffff, MWA_ROM },
  429.     { -1 }  /* end of table */
  430. };
  431.  
  432. static struct MemoryReadAddress rf2_gx400_readmem[] =
  433. {
  434.     { 0x000000, 0x00ffff, MRA_ROM },
  435.     { 0x010000, 0x01ffff, MRA_RAM },
  436.     { 0x020000, 0x0287ff, gx400_sharedram_r },
  437.     { 0x030000, 0x03ffff, nemesis_characterram_r },
  438.     { 0x050000, 0x0503ff, MRA_RAM },
  439.     { 0x050400, 0x0507ff, MRA_RAM },
  440.     { 0x050800, 0x050bff, MRA_RAM },
  441.     { 0x050c00, 0x050fff, MRA_RAM },
  442.     { 0x052000, 0x053fff, nemesis_videoram1_r },
  443.     { 0x054000, 0x055fff, nemesis_videoram2_r },
  444.     { 0x056000, 0x056fff, MRA_RAM },
  445.     { 0x05a000, 0x05afff, paletteram_word_r },
  446.     { 0x05c402, 0x05c403, input_port_4_r },    /* DSW0 */
  447.     { 0x05c404, 0x05c405, input_port_5_r },    /* DSW1 */
  448.     { 0x05c406, 0x05c407, input_port_3_r },    /* TEST */
  449.     { 0x05cc00, 0x05cc01, input_port_0_r },    /* IN0 */
  450.     { 0x05cc02, 0x05cc03, input_port_1_r },    /* IN1 */
  451.     { 0x05cc04, 0x05cc05, input_port_2_r },    /* IN2 */
  452.     { 0x060000, 0x067fff, MRA_RAM },
  453.     { 0x070000, 0x070001, konamigt_input_r },
  454.     { 0x080000, 0x0cffff, MRA_ROM },
  455.     { -1 }  /* end of table */
  456. };
  457.  
  458. static struct MemoryWriteAddress rf2_gx400_writemem[] =
  459. {
  460.     { 0x000000, 0x00ffff, MWA_ROM },
  461.     { 0x010000, 0x01ffff, MWA_RAM , &ram2},
  462.     { 0x020000, 0x0287ff, gx400_sharedram_w },
  463.     { 0x030000, 0x03ffff, nemesis_characterram_w, &nemesis_characterram, &nemesis_characterram_size },
  464.     { 0x050000, 0x0503ff, MWA_RAM, &nemesis_xscroll1 },
  465.     { 0x050400, 0x0507ff, MWA_RAM, &nemesis_xscroll2 },
  466.     { 0x050800, 0x050bff, MWA_RAM },
  467.     { 0x050c00, 0x050fff, MWA_RAM, &nemesis_yscroll },
  468.     { 0x051000, 0x051fff, MWA_NOP },        /* used, but written to with 0's */
  469.     { 0x052000, 0x053fff, nemesis_videoram1_w, &nemesis_videoram1 },    /* VRAM 1 */
  470.     { 0x054000, 0x055fff, nemesis_videoram2_w, &nemesis_videoram2 },    /* VRAM 2 */
  471.     { 0x056000, 0x056fff, MWA_RAM, &spriteram, &spriteram_size },
  472.     { 0x05a000, 0x05afff, nemesis_palette_w, &paletteram },
  473.     { 0x05c000, 0x05c001, nemesis_soundlatch_w },
  474.     { 0x05c800, 0x05c801, watchdog_reset_w },    /* probably */
  475.     { 0x05e000, 0x05e001, &gx400_irq2_enable_w },    /* ?? */
  476.     { 0x05e002, 0x05e003, &gx400_irq1_enable_w },    /* ?? */
  477.     { 0x05e004, 0x05e005, MWA_NOP}, /*    bit 8 of the word probably triggers IRQ on sound board */
  478.     { 0x05e008, 0x05e009, MWA_NOP },    /* IRQ acknowledge??? */
  479.     { 0x05e00e, 0x05e00f, &gx400_irq4_enable_w },    /* ?? */
  480.     { 0x060000, 0x067fff, MWA_RAM, &ram },    /* WORK RAM */
  481.     { 0x080000, 0x0cffff, MWA_ROM },
  482.     { -1 }  /* end of table */
  483. };
  484.  
  485. static struct MemoryReadAddress gx400_sound_readmem[] =
  486. {
  487.     { 0x0000, 0x1fff, MRA_ROM },
  488.     { 0x4000, 0x87ff, MRA_RAM },
  489.     { 0xe001, 0xe001, soundlatch_r },
  490.     { 0xe086, 0xe086, AY8910_read_port_0_r },
  491.     { 0xe205, 0xe205, AY8910_read_port_1_r },
  492.     { -1 }  /* end of table */
  493. };
  494.  
  495. static struct MemoryWriteAddress gx400_sound_writemem[] =
  496. {
  497.     { 0x0000, 0x1fff, MWA_ROM },
  498.     { 0x4000, 0x87ff, MWA_RAM, &gx400_shared_ram },
  499.     { 0xa000, 0xafff, k005289_pitch_A_w },
  500.     { 0xc000, 0xcfff, k005289_pitch_B_w },
  501.     { 0xe000, 0xe000, VLM5030_data_w },
  502.     { 0xe003, 0xe003, k005289_keylatch_A_w },
  503.     { 0xe004, 0xe004, k005289_keylatch_B_w },
  504.     { 0xe005, 0xe005, AY8910_control_port_1_w },
  505.     { 0xe006, 0xe006, AY8910_control_port_0_w },
  506.     { 0xe030, 0xe030, gx400_speech_start_w },
  507.     { 0xe106, 0xe106, AY8910_write_port_0_w },
  508.     { 0xe405, 0xe405, AY8910_write_port_1_w },
  509.     { -1 }  /* end of table */
  510. };
  511.  
  512. /******************************************************************************/
  513.  
  514. static struct MemoryReadAddress salamand_readmem[] =
  515. {
  516.     { 0x000000, 0x07ffff, MRA_ROM },  /* ROM BIOS */
  517.     { 0x080000, 0x087fff, MRA_BANK1 },
  518.     { 0x090000, 0x091fff, paletteram_word_r },
  519.     { 0x0c0002, 0x0c0003, input_port_3_r },    /* DSW0 */
  520.     { 0x0c2000, 0x0c2001, input_port_0_r },    /* Coins, start buttons, test mode */
  521.     { 0x0c2002, 0x0c2003, input_port_1_r },    /* IN1 */
  522.     { 0x0c2004, 0x0c2005, input_port_2_r },    /* IN2 */
  523.     { 0x0c2006, 0x0c2007, input_port_4_r },    /* DSW1 */
  524.     { 0x100000, 0x101fff, nemesis_videoram1_r },
  525.     { 0x102000, 0x103fff, nemesis_videoram2_r },
  526.     { 0x120000, 0x12ffff, nemesis_characterram_r },
  527.     { 0x180000, 0x180fff, MRA_BANK7 },
  528.     { 0x190000, 0x1903ff, gx400_xscroll1_r },
  529.     { 0x190400, 0x1907ff, gx400_xscroll2_r },
  530.     { 0x190800, 0x191fff, gx400_yscroll_r },
  531.     { -1 }  /* end of table */
  532. };
  533.  
  534. static struct MemoryWriteAddress salamand_writemem[] =
  535. {
  536.     { 0x000000, 0x07ffff, MWA_ROM },
  537.     { 0x080000, 0x087fff, MWA_BANK1, &ram },
  538.     { 0x090000, 0x091fff, salamander_palette_w, &paletteram },
  539.     { 0x0A0000, 0x0A0001, nemesis_irq_enable_w },          /* irq enable */
  540.     { 0x0C0000, 0x0C0001, salamand_soundlatch_w },
  541.     { 0x0C0004, 0x0C0005, MWA_NOP },        /* Watchdog at $c0005 */
  542.     { 0x100000, 0x101fff, nemesis_videoram1_w, &nemesis_videoram1 },    /* VRAM 1 */
  543.     { 0x102000, 0x103fff, nemesis_videoram2_w, &nemesis_videoram2 },    /* VRAM 2 */
  544.     { 0x120000, 0x12ffff, nemesis_characterram_w, &nemesis_characterram, &nemesis_characterram_size },
  545.     { 0x180000, 0x180fff, MWA_BANK7, &spriteram, &spriteram_size },        /* more sprite ram ??? */
  546.     { 0x190000, 0x1903ff, gx400_xscroll1_w, &nemesis_xscroll1 },
  547.     { 0x190400, 0x1907ff, gx400_xscroll2_w, &nemesis_xscroll2 },
  548.     { 0x190800, 0x191fff, gx400_yscroll_w, &nemesis_yscroll },
  549.     { -1 }  /* end of table */
  550. };
  551.  
  552. static READ_HANDLER( wd_r )
  553. {
  554.     static int a=1;
  555.     a^= 1;
  556.     return a;
  557. }
  558.  
  559. static struct MemoryReadAddress sal_sound_readmem[] =
  560. {
  561.     { 0x0000, 0x7fff, MRA_ROM },
  562.     { 0x8000, 0x87ff, MRA_RAM },
  563.     { 0xa000, 0xa000, soundlatch_r },
  564.     { 0xb000, 0xb00d, K007232_read_port_0_r },
  565.     { 0xc001, 0xc001, YM2151_status_port_0_r },
  566.     { 0xe000, 0xe000, wd_r }, /* watchdog?? */
  567.     { -1 }  /* end of table */
  568. };
  569.  
  570. static struct MemoryWriteAddress sal_sound_writemem[] =
  571. {
  572.     { 0x0000, 0x7fff, MWA_ROM },
  573.     { 0x8000, 0x87ff, MWA_RAM },
  574.     { 0xb000, 0xb00d, K007232_write_port_0_w },
  575.     { 0xc000, 0xc000, YM2151_register_port_0_w },
  576.     { 0xc001, 0xc001, YM2151_data_port_0_w },
  577.     { 0xd000, 0xd000, VLM5030_data_w },
  578.     { 0xf000, 0xf000, salamand_speech_start_w },
  579.     { -1 }  /* end of table */
  580. };
  581.  
  582. /******************************************************************************/
  583.  
  584. #define GX400_COINAGE_DIP \
  585.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) \
  586.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) ) \
  587.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) ) \
  588.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) ) \
  589.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) ) \
  590.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) ) \
  591.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) ) \
  592.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) ) \
  593.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) ) \
  594.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) ) \
  595.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) ) \
  596.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) ) \
  597.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) ) \
  598.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) ) \
  599.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) ) \
  600.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) ) \
  601.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) ) \
  602.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) \
  603.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) ) \
  604.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) ) \
  605.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) ) \
  606.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) ) \
  607.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) ) \
  608.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) ) \
  609.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) ) \
  610.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) ) \
  611.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) ) \
  612.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) ) \
  613.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) ) \
  614.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) ) \
  615.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) ) \
  616.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) ) \
  617.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) ) \
  618.     PORT_DIPSETTING(    0x00, "Disabled" )
  619.  
  620.  
  621. INPUT_PORTS_START( nemesis )
  622.     PORT_START    /* IN0 */
  623.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  624.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  625.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  626.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  627.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  628.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  629.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  630.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  631.  
  632.     PORT_START    /* IN1 */
  633.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  634.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  635.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  636.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  637.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER1 )
  638.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  639.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  640.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  641.  
  642.     PORT_START    /* IN2 */
  643.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  644.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  645.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  646.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  647.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  648.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  649.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  650.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  651.  
  652.     PORT_START    /* TEST */
  653.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  654.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  655.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  656.     PORT_DIPNAME( 0x02, 0x02, "Version" )
  657.     PORT_DIPSETTING(    0x02, "Normal" )
  658.     PORT_DIPSETTING(    0x00, "Vs" )
  659.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  660.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  661.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  662.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  663.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  664.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  665.  
  666.     PORT_START    /* DSW0 */
  667.     GX400_COINAGE_DIP
  668.  
  669.     PORT_START    /* DSW1 */
  670.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  671.     PORT_DIPSETTING(    0x03, "3" )
  672.     PORT_DIPSETTING(    0x02, "4" )
  673.     PORT_DIPSETTING(    0x01, "5" )
  674.     PORT_DIPSETTING(    0x00, "7" )
  675.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  676.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  677.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  678.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  679.     PORT_DIPSETTING(    0x18, "50k and every 100k" )
  680.     PORT_DIPSETTING(    0x10, "30k" )
  681.     PORT_DIPSETTING(    0x08, "50k" )
  682.     PORT_DIPSETTING(    0x00, "100k" )
  683.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  684.     PORT_DIPSETTING(    0x60, "Easy" )
  685.     PORT_DIPSETTING(    0x40, "Normal" )
  686.     PORT_DIPSETTING(    0x20, "Difficult" )
  687.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  688.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  689.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  690.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  691. INPUT_PORTS_END
  692.  
  693.  
  694. INPUT_PORTS_START( nemesuk )
  695.     PORT_START    /* IN0 */
  696.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  697.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  698.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  699.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  700.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  701.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  702.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  703.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  704.  
  705.     PORT_START    /* IN1 */
  706.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  707.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  708.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  709.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  710.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER1 )
  711.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  712.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  713.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  714.  
  715.     PORT_START    /* IN2 */
  716.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  717.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  718.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  719.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  720.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  721.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  722.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  723.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  724.  
  725.     PORT_START    /* TEST */
  726.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  727.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  728.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  729.     PORT_DIPNAME( 0x02, 0x02, "Version" )
  730.     PORT_DIPSETTING(    0x02, "Normal" )
  731.     PORT_DIPSETTING(    0x00, "Vs" )
  732.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  733.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  734.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  735.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  736.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  737.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  738.  
  739.     PORT_START    /* DSW0 */
  740.     GX400_COINAGE_DIP
  741.  
  742.     PORT_START    /* DSW1 */
  743.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  744.     PORT_DIPSETTING(    0x03, "2" )
  745.     PORT_DIPSETTING(    0x02, "3" )
  746.     PORT_DIPSETTING(    0x01, "5" )
  747.     PORT_DIPSETTING(    0x00, "7" )
  748.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  749.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  750.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  751.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  752.     PORT_DIPSETTING(    0x18, "20k and every 70k" )
  753.     PORT_DIPSETTING(    0x10, "30k and every 80k" )
  754.     PORT_DIPSETTING(    0x08, "20k" )
  755.     PORT_DIPSETTING(    0x00, "30k" )
  756.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  757.     PORT_DIPSETTING(    0x60, "Easy" )
  758.     PORT_DIPSETTING(    0x40, "Normal" )
  759.     PORT_DIPSETTING(    0x20, "Difficult" )
  760.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  761.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  762.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  763.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  764. INPUT_PORTS_END
  765.  
  766.  
  767. /* This needs to be sorted */
  768. INPUT_PORTS_START( konamigt )
  769.     PORT_START    /* IN0 */
  770.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  771.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  772.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  773.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  774.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  775.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  776.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  777.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  778.  
  779.     PORT_START    /* IN1 */
  780.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 )
  781.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  782.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  783.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
  784.  
  785.     PORT_START    /* IN2 */
  786.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 )
  787.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  788.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_PLAYER2 )
  789.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 )
  790.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  791.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  792.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  793.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  794.  
  795.     PORT_START    /* TEST */
  796.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  797.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  798.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  799.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  800.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  801.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  802.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  803.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  804.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  805.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  806.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  807.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  808.  
  809.     PORT_START    /* DSW0 */
  810.     GX400_COINAGE_DIP
  811.  
  812.     PORT_START    /* DSW1 */
  813.     PORT_DIPNAME( 0x01, 0x01, "Unknown" )
  814.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  815.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  816.     PORT_DIPNAME( 0x02, 0x02, "Unknown" )
  817.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  818.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  819.     PORT_DIPNAME( 0x04, 0x04, "Unknown" )
  820.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  821.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  822.     PORT_DIPNAME( 0x08, 0x08, "Unknown" )
  823.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  824.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  825.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
  826.     PORT_DIPSETTING(    0x30, "Easy" )
  827.     PORT_DIPSETTING(    0x20, "Normal" )
  828.     PORT_DIPSETTING(    0x10, "Difficult" )
  829.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  830.     PORT_DIPNAME( 0x40, 0x40, "Unknown" )
  831.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  832.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  833.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  834.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  835.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  836.  
  837.     PORT_START    /* IN6 */
  838.     PORT_ANALOG( 0xff, 0x40, IPT_DIAL, 25, 10, 0x00, 0x7f )
  839. INPUT_PORTS_END
  840.  
  841.  
  842. /* This needs to be sorted */
  843. INPUT_PORTS_START( rf2 )
  844.     PORT_START    /* IN0 */
  845.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  846.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  847.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  848.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  849.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  850.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  851.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  852.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  853.  
  854.     PORT_START    /* IN1 */
  855.     PORT_BIT( 0x10, IP_ACTIVE_LOW,  IPT_BUTTON3 )
  856.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 )
  857.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  858.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 )
  859.  
  860.     PORT_START    /* IN2 */
  861.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_PLAYER2 )
  862.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_PLAYER2 )
  863.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_PLAYER2 )
  864.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_PLAYER2 )
  865.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  866.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  867.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  868.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  869.  
  870.     PORT_START    /* TEST */
  871.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  872.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  873.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  874.     PORT_DIPNAME( 0x02, 0x02, "Unknown" )
  875.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  876.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  877.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  878.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  879.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  880.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  881.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  882.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  883.  
  884.     PORT_START    /* DSW0 */
  885.     GX400_COINAGE_DIP
  886.  
  887.     PORT_START    /* DSW1 */
  888.     PORT_DIPNAME( 0x01, 0x00, "Unknown" )
  889.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  890.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  891.     PORT_DIPNAME( 0x02, 0x00, "Unknown" )
  892.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  893.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  894.     PORT_DIPNAME( 0x04, 0x00, "Unknown" )
  895.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  896.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  897.     PORT_DIPNAME( 0x08, 0x00, "Unknown" )
  898.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  899.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  900.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
  901.     PORT_DIPSETTING(    0x30, "Easy" )
  902.     PORT_DIPSETTING(    0x20, "Normal" )
  903.     PORT_DIPSETTING(    0x10, "Difficult" )
  904.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  905.     PORT_DIPNAME( 0x40, 0x00, "Unknown" )
  906.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  907.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  908.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  909.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  910.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  911.  
  912.     PORT_START    /* IN6 */
  913.     PORT_ANALOG( 0xff, 0x40, IPT_DIAL, 25, 10, 0x00, 0x7f )
  914. INPUT_PORTS_END
  915.  
  916.  
  917. INPUT_PORTS_START( gwarrior )
  918.     PORT_START    /* IN0 */
  919.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  920.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  921.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  922.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  923.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  924.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  925.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  926.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  927.  
  928.     PORT_START    /* IN1 */
  929.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  930.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  931.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  932.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  933.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  934.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  935.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  936.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  937.  
  938.     PORT_START    /* IN2 */
  939.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  940.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  941.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  942.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  943.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  944.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  945.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  946.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  947.  
  948.     PORT_START    /* TEST */
  949.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  950.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  951.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  952.     PORT_DIPNAME( 0x02, 0x02, "Version" )
  953.     PORT_DIPSETTING(    0x02, "Normal" )
  954.     PORT_DIPSETTING(    0x00, "Vs" )
  955.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  956.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  957.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  958.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  959.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  960.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  961.  
  962.     PORT_START    /* DSW0 */
  963.     GX400_COINAGE_DIP
  964.  
  965.     PORT_START    /* DSW1 */
  966.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
  967.     PORT_DIPSETTING(    0x03, "1" )
  968.     PORT_DIPSETTING(    0x02, "2" )
  969.     PORT_DIPSETTING(    0x01, "3" )
  970.     PORT_DIPSETTING(    0x00, "7" )
  971.     PORT_DIPNAME( 0x04, 0x00, "Unknown" )
  972.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  973.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  974.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  975.     PORT_DIPSETTING(    0x18, "30k 100k 200k 400k" )
  976.     PORT_DIPSETTING(    0x10, "40k 120k 240k 480k" )
  977.     PORT_DIPSETTING(    0x08, "50k 150k 300k 600k" )
  978.     PORT_DIPSETTING(    0x00, "100k 200k 400k 800k" )
  979.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  980.     PORT_DIPSETTING(    0x60, "Easy" )
  981.     PORT_DIPSETTING(    0x40, "Normal" )
  982.     PORT_DIPSETTING(    0x20, "Difficult" )
  983.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  984.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  985.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  986.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  987. INPUT_PORTS_END
  988.  
  989.  
  990. INPUT_PORTS_START( twinbee )
  991.     PORT_START    /* IN0 */
  992.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  993.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  994.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  995.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  996.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  997.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  998.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  999.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1000.  
  1001.     PORT_START    /* IN1 */
  1002.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1003.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1004.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1005.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1006.  
  1007.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1008.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  1009.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  1010.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1011.  
  1012.     PORT_START    /* IN2 */
  1013.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  1014.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1015.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  1016.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1017.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1018.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1019.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  1020.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1021.  
  1022.     PORT_START    /* TEST */
  1023.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  1024.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  1025.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1026.     PORT_DIPNAME( 0x02, 0x02, "Version" )
  1027.     PORT_DIPSETTING(    0x02, "Normal" )
  1028.     PORT_DIPSETTING(    0x00, "Vs" )
  1029.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  1030.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1031.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1032.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1033.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1034.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1035.  
  1036.     PORT_START    /* DSW0 */
  1037.     GX400_COINAGE_DIP
  1038.  
  1039.     PORT_START    /* DSW1 */
  1040.     PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
  1041.     PORT_DIPSETTING(    0x03, "2" )
  1042.     PORT_DIPSETTING(    0x02, "3" )
  1043.     PORT_DIPSETTING(    0x01, "4" )
  1044.     PORT_DIPSETTING(    0x00, "7" )
  1045.     PORT_DIPNAME( 0x04, 0x00, "Unknown" )
  1046.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  1047.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1048.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  1049.     PORT_DIPSETTING(    0x18, "30k and every 70k" )
  1050.     PORT_DIPSETTING(    0x10, "40k and every 80k" )
  1051.     PORT_DIPSETTING(    0x08, "50k and every 100k" )
  1052.     PORT_DIPSETTING(    0x00, "100k and every 100k" )
  1053.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  1054.     PORT_DIPSETTING(    0x60, "Easy" )
  1055.     PORT_DIPSETTING(    0x40, "Normal" )
  1056.     PORT_DIPSETTING(    0x20, "Difficult" )
  1057.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  1058.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  1059.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1060.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1061. INPUT_PORTS_END
  1062.  
  1063.  
  1064. INPUT_PORTS_START( gradius )
  1065.     PORT_START    /* IN0 */
  1066.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  1067.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  1068.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  1069.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  1070.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  1071.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1072.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1073.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1074.  
  1075.     PORT_START    /* IN1 */
  1076.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1077.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1078.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1079.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1080.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  1081.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  1082.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  1083.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1084.  
  1085.     PORT_START    /* IN2 */
  1086.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  1087.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1088.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  1089.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1090.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  1091.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  1092.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  1093.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1094.  
  1095.     PORT_START    /* TEST */
  1096.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  1097.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  1098.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1099.     PORT_DIPNAME( 0x02, 0x02, "Version" )
  1100.     PORT_DIPSETTING(    0x02, "Normal" )
  1101.     PORT_DIPSETTING(    0x00, "Vs" )
  1102.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  1103.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1104.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1105.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1106.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1107.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  1108.  
  1109.     PORT_START    /* DSW0 */
  1110.     GX400_COINAGE_DIP
  1111.  
  1112.     PORT_START    /* DSW1 */
  1113.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1114.     PORT_DIPSETTING(    0x03, "3" )
  1115.     PORT_DIPSETTING(    0x02, "4" )
  1116.     PORT_DIPSETTING(    0x01, "5" )
  1117.     PORT_DIPSETTING(    0x00, "7" )
  1118.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  1119.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1120.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  1121.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  1122.     PORT_DIPSETTING(    0x18, "20k and every 70k" )
  1123.     PORT_DIPSETTING(    0x10, "30k and every 80k" )
  1124.     PORT_DIPSETTING(    0x08, "20k only" )
  1125.     PORT_DIPSETTING(    0x00, "30k only" )
  1126.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  1127.     PORT_DIPSETTING(    0x60, "Easy" )
  1128.     PORT_DIPSETTING(    0x40, "Normal" )
  1129.     PORT_DIPSETTING(    0x20, "Difficult" )
  1130.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  1131.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  1132.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1133.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1134. INPUT_PORTS_END
  1135.  
  1136.  
  1137. INPUT_PORTS_START( salamand )
  1138.     PORT_START    /* IN0 */
  1139.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1140.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1141.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  1142.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  1143.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  1144.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  1145.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1146.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1147.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1148.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1149.  
  1150.     PORT_START    /* IN1 */
  1151.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1152.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1153.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1154.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1155.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  1156.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  1157.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER1 )
  1158.     PORT_DIPNAME( 0x80, 0x00, "Sound Type" )
  1159.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1160.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1161.  
  1162.     PORT_START    /* IN2 */
  1163.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  1164.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1165.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  1166.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1167.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  1168.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  1169.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  1170.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1171.  
  1172.  
  1173.     PORT_START    /* DSW0 */
  1174.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
  1175.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  1176.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  1177.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  1178.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  1179.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  1180.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  1181.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  1182.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  1183.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  1184.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  1185.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  1186.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  1187.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  1188.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  1189.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  1190.     PORT_DIPSETTING(    0x00, "Disabled" )
  1191.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  1192.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  1193.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1194.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  1195.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1196.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1197.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  1198.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  1199.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1200.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  1201.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1202.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1203.  
  1204.     PORT_START    /* DSW1 */
  1205.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1206.     PORT_DIPSETTING(    0x03, "2" )
  1207.     PORT_DIPSETTING(    0x02, "3" )
  1208.     PORT_DIPSETTING(    0x01, "5" )
  1209.     PORT_DIPSETTING(    0x00, "7" )
  1210.     PORT_DIPNAME( 0x04, 0x04, "Coin Slot(s)" )
  1211.     PORT_DIPSETTING(    0x04, "1" )
  1212.     PORT_DIPSETTING(    0x00, "2" )
  1213.     PORT_DIPNAME( 0x18, 0x00, "Max Credit(s)" )
  1214.     PORT_DIPSETTING(    0x18, "1" )
  1215.     PORT_DIPSETTING(    0x10, "3" )
  1216.     PORT_DIPSETTING(    0x08, "5" )
  1217.     PORT_DIPSETTING(    0x00, "9" )
  1218.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  1219.     PORT_DIPSETTING(    0x60, "Easy" )
  1220.     PORT_DIPSETTING(    0x40, "Normal" )
  1221.     PORT_DIPSETTING(    0x20, "Difficult" )
  1222.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  1223.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  1224.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1225.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1226. INPUT_PORTS_END
  1227.  
  1228.  
  1229. INPUT_PORTS_START( lifefrcj )
  1230.     PORT_START    /* IN0 */
  1231.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  1232.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  1233.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 )
  1234.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  1235.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  1236.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) )
  1237.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  1238.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1239.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1240.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  1241.  
  1242.     PORT_START    /* IN1 */
  1243.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  1244.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  1245.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  1246.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  1247.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER1 )
  1248.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER1 )
  1249.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER1 )
  1250.     PORT_DIPNAME( 0x80, 0x00, "Sound Type" )
  1251.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  1252.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  1253.  
  1254.     PORT_START    /* IN2 */
  1255.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  1256.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  1257.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  1258.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  1259.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON3 | IPF_PLAYER2 )
  1260.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_PLAYER2 )
  1261.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 | IPF_PLAYER2 )
  1262.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  1263.  
  1264.  
  1265.     PORT_START    /* DSW0 */
  1266.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  1267.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  1268.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  1269.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  1270.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  1271.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  1272.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  1273.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  1274.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  1275.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  1276.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  1277.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  1278.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  1279.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  1280.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  1281.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  1282.     PORT_DIPSETTING(    0x00, "Disabled" )
  1283.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  1284.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  1285.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  1286.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  1287.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  1288.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  1289.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  1290.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  1291.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  1292.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  1293.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  1294.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  1295.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  1296.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  1297.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  1298.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  1299.     PORT_DIPSETTING(    0x00, "Disabled" )
  1300.  
  1301.     PORT_START    /* DSW1 */
  1302.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  1303.     PORT_DIPSETTING(    0x03, "3" )
  1304.     PORT_DIPSETTING(    0x02, "4" )
  1305.     PORT_DIPSETTING(    0x01, "5" )
  1306.     PORT_DIPSETTING(    0x00, "6" )
  1307.     PORT_DIPNAME( 0x04, 0x04, "Coin Counter(s)" )
  1308.     PORT_DIPSETTING(    0x04, "1" )
  1309.     PORT_DIPSETTING(    0x00, "2" )
  1310.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  1311.     PORT_DIPSETTING(    0x18, "70k and every 200k" )
  1312.     PORT_DIPSETTING(    0x10, "100k and every 300k" )
  1313.     PORT_DIPSETTING(    0x08, "70k only" )
  1314.     PORT_DIPSETTING(    0x00, "100k only" )
  1315.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  1316.     PORT_DIPSETTING(    0x60, "Easy" )
  1317.     PORT_DIPSETTING(    0x40, "Normal" )
  1318.     PORT_DIPSETTING(    0x20, "Difficult" )
  1319.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  1320.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
  1321.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  1322.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  1323. INPUT_PORTS_END
  1324.  
  1325. /******************************************************************************/
  1326.  
  1327. static struct GfxLayout charlayout =
  1328. {
  1329.     8,8,    /* 8*8 characters */
  1330.     2048,    /* 2048 characters */
  1331.     4,    /* 4 bits per pixel */
  1332.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1333.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 },
  1334.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  1335.     32*8     /* every char takes 32 consecutive bytes */
  1336. };
  1337.  
  1338. static struct GfxLayout spritelayout =
  1339. {
  1340.     16,16,    /* 16*16 sprites */
  1341.     512,    /* 512 sprites */
  1342.     4,    /* 4 bits per pixel */
  1343.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1344.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  1345.             8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4 },
  1346.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
  1347.             8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
  1348.     128*8     /* every sprite takes 128 consecutive bytes */
  1349. };
  1350.  
  1351. static struct GfxLayout spritelayout3216 =
  1352. {
  1353.     32,16,    /* 32*16 sprites */
  1354.     256,    /* 256 sprites */
  1355.     4,    /* 4 bits per pixel */
  1356.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1357.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  1358.             8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4,
  1359.            16*4,17*4, 18*4, 19*4, 20*4, 21*4, 22*4, 23*4,
  1360.            24*4,25*4, 26*4, 27*4, 28*4, 29*4, 30*4, 31*4},
  1361.     { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128,
  1362.             8*128, 9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128 },
  1363.     256*8     /* every sprite takes 128 consecutive bytes */
  1364. };
  1365.  
  1366. static struct GfxLayout spritelayout1632 =
  1367. {
  1368.     16,32,    /* 16*32 sprites */
  1369.     256,    /* 256 sprites */
  1370.     4,    /* 4 bits per pixel */
  1371.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1372.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  1373.             8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4},
  1374.     { 0*64,  1*64,  2*64,  3*64,  4*64,  5*64,  6*64,  7*64,
  1375.       8*64,  9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64,
  1376.      16*64, 17*64, 18*64, 19*64, 20*64, 21*64, 22*64, 23*64,
  1377.      24*64, 25*64, 26*64, 27*64, 28*64, 29*64, 30*64, 31*64},
  1378.     256*8     /* every sprite takes 128 consecutive bytes */
  1379. };
  1380.  
  1381. static struct GfxLayout spritelayout3232 =
  1382. {
  1383.     32,32,    /* 32*32 sprites */
  1384.     128,    /* 128 sprites */
  1385.     4,    /* 4 bits per pixel */
  1386.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1387.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  1388.             8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4,
  1389.            16*4,17*4, 18*4, 19*4, 20*4, 21*4, 22*4, 23*4,
  1390.            24*4,25*4, 26*4, 27*4, 28*4, 29*4, 30*4, 31*4},
  1391.     { 0*128, 1*128, 2*128, 3*128, 4*128, 5*128, 6*128, 7*128,
  1392.             8*128,  9*128, 10*128, 11*128, 12*128, 13*128, 14*128, 15*128,
  1393.            16*128, 17*128, 18*128, 19*128, 20*128, 21*128, 22*128, 23*128,
  1394.            24*128, 25*128, 26*128, 27*128, 28*128, 29*128, 30*128, 31*128},
  1395.     512*8     /* every sprite takes 128 consecutive bytes */
  1396. };
  1397.  
  1398. static struct GfxLayout spritelayout816 =
  1399. {
  1400.     8,16,    /* 16*16 sprites */
  1401.     1024,    /* 1024 sprites */
  1402.     4,    /* 4 bits per pixel */
  1403.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1404.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4},
  1405.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  1406.             8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
  1407.     64*8     /* every sprite takes 128 consecutive bytes */
  1408. };
  1409.  
  1410. static struct GfxLayout spritelayout168 =
  1411. {
  1412.     16,8,    /* 16*8 sprites */
  1413.     1024,    /* 1024 sprites */
  1414.     4,    /* 4 bits per pixel */
  1415.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1416.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  1417.             8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4},
  1418.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64},
  1419.     64*8     /* every sprite takes 128 consecutive bytes */
  1420.  
  1421. };
  1422.  
  1423. static struct GfxLayout spritelayout6464 =
  1424. {
  1425.     64,64,    /* 32*32 sprites */
  1426.     32,    /* 128 sprites */
  1427.     4,    /* 4 bits per pixel */
  1428.     { 0, 1, 2, 3 }, /* the two bitplanes are merged in the same nibble */
  1429.     { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4,
  1430.             8*4, 9*4, 10*4, 11*4, 12*4, 13*4, 14*4, 15*4,
  1431.            16*4,17*4, 18*4, 19*4, 20*4, 21*4, 22*4, 23*4,
  1432.            24*4,25*4, 26*4, 27*4, 28*4, 29*4, 30*4, 31*4,
  1433.            32*4,33*4, 34*4, 35*4, 36*4, 37*4, 38*4, 39*4,
  1434.            40*4,41*4, 42*4, 43*4, 44*4, 45*4, 46*4, 47*4,
  1435.            48*4,49*4, 50*4, 51*4, 52*4, 53*4, 54*4, 55*4,
  1436.            56*4,57*4, 58*4, 59*4, 60*4, 61*4, 62*4, 63*4},
  1437.  
  1438.     { 0*256, 1*256, 2*256, 3*256, 4*256, 5*256, 6*256, 7*256,
  1439.             8*256,  9*256, 10*256, 11*256, 12*256, 13*256, 14*256, 15*256,
  1440.            16*256, 17*256, 18*256, 19*256, 20*256, 21*256, 22*256, 23*256,
  1441.            24*256, 25*256, 26*256, 27*256, 28*256, 29*256, 30*256, 31*256,
  1442.            32*256, 33*256, 34*256, 35*256, 36*256, 37*256, 38*256, 39*256,
  1443.            40*256, 41*256, 42*256, 43*256, 44*256, 45*256, 46*256, 47*256,
  1444.            48*256, 49*256, 50*256, 51*256, 52*256, 53*256, 54*256, 55*256,
  1445.            56*256, 57*256, 58*256, 59*256, 60*256, 61*256, 62*256, 63*256},
  1446.     2048*8     /* every sprite takes 128 consecutive bytes */
  1447. };
  1448.  
  1449. static struct GfxDecodeInfo gfxdecodeinfo[] =
  1450. {
  1451.     { 0, 0x0, &charlayout,   0, 0x80 },    /* the game dynamically modifies this */
  1452.     { 0, 0x0, &spritelayout, 0, 0x80 },    /* the game dynamically modifies this */
  1453.     { 0, 0x0, &spritelayout3216, 0, 0x80 },    /* the game dynamically modifies this */
  1454.     { 0, 0x0, &spritelayout816, 0, 0x80 },    /* the game dynamically modifies this */
  1455.     { 0, 0x0, &spritelayout3232, 0, 0x80 },    /* the game dynamically modifies this */
  1456.     { 0, 0x0, &spritelayout1632, 0, 0x80 },    /* the game dynamically modifies this */
  1457.     { 0, 0x0, &spritelayout168, 0, 0x80 },    /* the game dynamically modifies this */
  1458.     { 0, 0x0, &spritelayout6464, 0, 0x80 },    /* the game dynamically modifies this */
  1459.     { -1 }
  1460. };
  1461.  
  1462. /******************************************************************************/
  1463.  
  1464. static struct AY8910interface ay8910_interface =
  1465. {
  1466.     2,              /* 2 chips */
  1467.     14318180/8,     /* 1.78975 Mhz */
  1468.     { 30, 30 },
  1469.     { nemesis_portA_r, 0 },
  1470.     { 0, 0 },
  1471.     { 0, k005289_control_A_w },
  1472.     { 0, k005289_control_B_w }
  1473. };
  1474.  
  1475. static struct k005289_interface k005289_interface =
  1476. {
  1477.     3579545/2,        /* clock speed */
  1478.     22,                /* playback volume */
  1479.     REGION_SOUND1    /* prom memory region */
  1480. };
  1481.  
  1482. static void sound_irq(int state)
  1483. {
  1484. /* Interrupts _are_ generated, I wonder where they go.. */
  1485. /*cpu_cause_interrupt(1,Z80_IRQ_INT);*/
  1486. }
  1487.  
  1488. static struct YM2151interface ym2151_interface =
  1489. {
  1490.     1,
  1491.     3579545,
  1492.     { YM3012_VOL(45,MIXER_PAN_LEFT,45,MIXER_PAN_RIGHT) },
  1493.     { sound_irq }
  1494. };
  1495.  
  1496. static struct VLM5030interface vlm5030_interface =
  1497. {
  1498.     3579545,       /* master clock  */
  1499.     70,            /* volume        */
  1500.     REGION_SOUND1, /* memory region  */
  1501.     0,             /* memory length */
  1502.     0,             /* VCU            */
  1503. };
  1504.  
  1505. static struct VLM5030interface gx400_vlm5030_interface =
  1506. {
  1507.     3579545,       /* master clock  */
  1508.     100,           /* volume        */
  1509.     0,             /* memory region (RAM based) */
  1510.     0x0800,        /* memory length (not sure if correct) */
  1511.     0,             /* VCU            */
  1512. };
  1513.  
  1514. static void volume_callback(int v)
  1515. {
  1516.     K007232_set_volume(0,0,(v >> 4) * 0x11,0);
  1517.     K007232_set_volume(0,1,0,(v & 0x0f) * 0x11);
  1518. }
  1519.  
  1520. static struct K007232_interface k007232_interface =
  1521. {
  1522.     1,        /* number of chips */
  1523.     { REGION_SOUND2 },    /* memory regions */
  1524.     { K007232_VOL(15,MIXER_PAN_CENTER,15,MIXER_PAN_CENTER) },    /* volume */
  1525.     { volume_callback }    /* external port callback */
  1526. };
  1527.  
  1528. /******************************************************************************/
  1529.  
  1530. static struct MachineDriver machine_driver_nemesis =
  1531. {
  1532.     /* basic machine hardware */
  1533.     {
  1534.         {
  1535.             CPU_M68000,
  1536.             14318180/2,    /* From schematics, should be accurate */
  1537.             readmem,writemem,0,0,
  1538.             nemesis_interrupt,1
  1539.         },
  1540.         {
  1541.             CPU_Z80 | CPU_AUDIO_CPU,
  1542.             14318180/4, /* From schematics, should be accurate */
  1543.             sound_readmem,sound_writemem,0,0,
  1544.             ignore_interrupt,0    /* interrupts are triggered by the main CPU */
  1545.         },
  1546.     },
  1547.  
  1548.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  1549.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1550.     nemesis_init_machine,
  1551.  
  1552.     /* video hardware */
  1553.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1554.     gfxdecodeinfo,
  1555.     2048, 2048,
  1556.     0,
  1557.  
  1558.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1559.     0,
  1560.     nemesis_vh_start,
  1561.     nemesis_vh_stop,
  1562.     nemesis_vh_screenrefresh,
  1563.  
  1564.     /* sound hardware */
  1565.     0,0,0,0,
  1566.     {
  1567.         {
  1568.             SOUND_AY8910,
  1569.             &ay8910_interface
  1570.         },
  1571.         {
  1572.             SOUND_K005289,
  1573.             &k005289_interface,
  1574.         },
  1575.         {
  1576.             SOUND_VLM5030,
  1577.             &gx400_vlm5030_interface
  1578.         }
  1579.     }
  1580. };
  1581.  
  1582. static struct MachineDriver machine_driver_konamigt =
  1583. {
  1584.     /* basic machine hardware */
  1585.     {
  1586.         {
  1587.             CPU_M68000,
  1588.             7159090,     /* ??? */
  1589.             konamigt_readmem,konamigt_writemem,0,0,
  1590.             konamigt_interrupt,2
  1591.         },
  1592.         {
  1593.             CPU_Z80 | CPU_AUDIO_CPU,
  1594.             14318180/4,        /* 3.579545 MHz */
  1595.             sound_readmem,sound_writemem,0,0,
  1596.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  1597.         },
  1598.     },
  1599.  
  1600.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  1601.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1602.     nemesis_init_machine,
  1603.  
  1604.     /* video hardware */
  1605.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1606.     gfxdecodeinfo,
  1607.     2048, 2048,
  1608.     0,
  1609.  
  1610.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1611.     0,
  1612.     nemesis_vh_start,
  1613.     nemesis_vh_stop,
  1614.     nemesis_vh_screenrefresh,
  1615.  
  1616.     /* sound hardware */
  1617.     0,0,0,0,
  1618.     {
  1619.         {
  1620.             SOUND_AY8910,
  1621.             &ay8910_interface
  1622.         },
  1623.         {
  1624.             SOUND_K005289,
  1625.             &k005289_interface
  1626.         }
  1627.     }
  1628. };
  1629.  
  1630. static struct MachineDriver machine_driver_salamand =
  1631. {
  1632.     /* basic machine hardware */
  1633.     {
  1634.         {
  1635.             CPU_M68000,
  1636.             7159090*1.5,       /* ??? */
  1637.             salamand_readmem,salamand_writemem,0,0,
  1638.             salamand_interrupt,1
  1639.         },
  1640.         {
  1641.             CPU_Z80 | CPU_AUDIO_CPU,
  1642.             14318180/4,        /* 3.579545 MHz */
  1643.             sal_sound_readmem,sal_sound_writemem,0,0,
  1644.             ignore_interrupt,0
  1645.         },
  1646.     },
  1647.  
  1648.     60, DEFAULT_60HZ_VBLANK_DURATION,
  1649.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1650.     nemesis_init_machine,
  1651.  
  1652.     /* video hardware */
  1653.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1654.     gfxdecodeinfo,
  1655.     2048, 2048,
  1656.     0,
  1657.  
  1658.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE | VIDEO_UPDATE_BEFORE_VBLANK,
  1659.     0,
  1660.     nemesis_vh_start,
  1661.     nemesis_vh_stop,
  1662.     salamand_vh_screenrefresh,
  1663.  
  1664.     /* sound hardware */
  1665.     SOUND_SUPPORTS_STEREO,0,0,0,
  1666.     {
  1667.         {
  1668.             SOUND_VLM5030,
  1669.             &vlm5030_interface
  1670.         },
  1671.         {
  1672.             SOUND_K007232,
  1673.             &k007232_interface,
  1674.         },
  1675.         {
  1676.             SOUND_YM2151,
  1677.             &ym2151_interface
  1678.         }
  1679.     }
  1680. };
  1681.  
  1682. static struct MachineDriver machine_driver_gx400 =
  1683. {
  1684.     /* basic machine hardware */
  1685.     {
  1686.         {
  1687.             CPU_M68000,
  1688.             7159090*1.25,     /* ??? */
  1689.             gx400_readmem,gx400_writemem,0,0,
  1690.             gx400_interrupt,3
  1691.         },
  1692.         {
  1693.             CPU_Z80,// | CPU_AUDIO_CPU,
  1694.             14318180/4,        /* 3.579545 MHz */
  1695.             gx400_sound_readmem,gx400_sound_writemem,0,0,
  1696.             nmi_interrupt,1    /* interrupts are triggered by the main CPU */
  1697.         },
  1698.     },
  1699.  
  1700.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  1701.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1702.     nemesis_init_machine,
  1703.  
  1704.     /* video hardware */
  1705.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1706.     gfxdecodeinfo,
  1707.     2048, 2048,
  1708.     0,
  1709.  
  1710.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1711.     0,
  1712.     nemesis_vh_start,
  1713.     nemesis_vh_stop,
  1714.     nemesis_vh_screenrefresh,
  1715.  
  1716.     /* sound hardware */
  1717.     0,0,0,0,
  1718.     {
  1719.         {
  1720.             SOUND_AY8910,
  1721.             &ay8910_interface
  1722.         },
  1723.         {
  1724.             SOUND_K005289,
  1725.             &k005289_interface,
  1726.         },
  1727.         {
  1728.             SOUND_VLM5030,
  1729.             &gx400_vlm5030_interface
  1730.         }
  1731.     }
  1732. };
  1733.  
  1734. static struct MachineDriver machine_driver_twinbee_gx400 =
  1735. {
  1736.     /* basic machine hardware */
  1737.     {
  1738.         {
  1739.             CPU_M68000,
  1740.             7159090*1.25,     /* ??? */
  1741.             gx400_readmem,gx400_writemem,0,0,
  1742.             gx400_interrupt,3
  1743.         },
  1744.         {
  1745.             CPU_Z80, // | CPU_AUDIO_CPU,
  1746.             14318180/4,        /* 3.579545 MHz */
  1747.             gx400_sound_readmem,gx400_sound_writemem,0,0,
  1748.             nmi_interrupt,1    /* interrupts are triggered by the main CPU */
  1749.         },
  1750.     },
  1751.  
  1752.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  1753.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1754.     nemesis_init_machine,
  1755.  
  1756.     /* video hardware */
  1757.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1758.     gfxdecodeinfo,
  1759.     2048, 2048,
  1760.     0,
  1761.  
  1762.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1763.     0,
  1764.     nemesis_vh_start,
  1765.     nemesis_vh_stop,
  1766.     twinbee_vh_screenrefresh,
  1767.  
  1768.     /* sound hardware */
  1769.     0,0,0,0,
  1770.     {
  1771.         {
  1772.             SOUND_AY8910,
  1773.             &ay8910_interface
  1774.         },
  1775.         {
  1776.             SOUND_K005289,
  1777.             &k005289_interface,
  1778.         },
  1779.         {
  1780.             SOUND_VLM5030,
  1781.             &gx400_vlm5030_interface
  1782.         }
  1783.     }
  1784. };
  1785.  
  1786. static struct MachineDriver machine_driver_rf2_gx400 =
  1787. {
  1788.     /* basic machine hardware */
  1789.     {
  1790.         {
  1791.             CPU_M68000,
  1792.             7159090,     /* ??? */
  1793.             rf2_gx400_readmem,rf2_gx400_writemem,0,0,
  1794.             gx400_interrupt,3
  1795.         },
  1796.         {
  1797.             CPU_Z80 | CPU_AUDIO_CPU,
  1798.             14318180/4,        /* 3.579545 MHz */
  1799.             gx400_sound_readmem,gx400_sound_writemem,0,0,
  1800.             nmi_interrupt,1    /* interrupts are triggered by the main CPU */
  1801.         },
  1802.     },
  1803.  
  1804.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
  1805.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  1806.     nemesis_init_machine,
  1807.  
  1808.     /* video hardware */
  1809.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  1810.     gfxdecodeinfo,
  1811.     2048, 2048,
  1812.     0,
  1813.  
  1814.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  1815.     0,
  1816.     nemesis_vh_start,
  1817.     nemesis_vh_stop,
  1818.     nemesis_vh_screenrefresh,
  1819.  
  1820.     /* sound hardware */
  1821.     0,0,0,0,
  1822.     {
  1823.         {
  1824.             SOUND_AY8910,
  1825.             &ay8910_interface
  1826.         },
  1827.         {
  1828.             SOUND_K005289,
  1829.             &k005289_interface,
  1830.         },
  1831.         {
  1832.             SOUND_VLM5030,
  1833.             &gx400_vlm5030_interface
  1834.         }
  1835.     }
  1836. };
  1837.  
  1838. /***************************************************************************
  1839.  
  1840.   Game driver(s)
  1841.  
  1842. ***************************************************************************/
  1843.  
  1844. ROM_START( nemesis )
  1845.     ROM_REGION( 0x40000, REGION_CPU1 )    /* 4 * 64k for code and rom */
  1846.     ROM_LOAD_EVEN( "12a_01.bin",   0x00000, 0x8000, 0x35ff1aaa )
  1847.     ROM_LOAD_ODD ( "12c_05.bin",   0x00000, 0x8000, 0x23155faa )
  1848.     ROM_LOAD_EVEN( "13a_02.bin",   0x10000, 0x8000, 0xac0cf163 )
  1849.     ROM_LOAD_ODD ( "13c_06.bin",   0x10000, 0x8000, 0x023f22a9 )
  1850.     ROM_LOAD_EVEN( "14a_03.bin",   0x20000, 0x8000, 0x8cefb25f )
  1851.     ROM_LOAD_ODD ( "14c_07.bin",   0x20000, 0x8000, 0xd50b82cb )
  1852.     ROM_LOAD_EVEN( "15a_04.bin",   0x30000, 0x8000, 0x9ca75592 )
  1853.     ROM_LOAD_ODD ( "15c_08.bin",   0x30000, 0x8000, 0x03c0b7f5 )
  1854.  
  1855.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1856.     ROM_LOAD(      "09c_snd.bin",  0x00000, 0x4000, 0x26bf9636 )
  1857.  
  1858.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1859.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1860.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1861. ROM_END
  1862.  
  1863. ROM_START( nemesuk )
  1864.     ROM_REGION( 0x40000, REGION_CPU1 )    /* 4 * 64k for code and rom */
  1865.     ROM_LOAD_EVEN( "12a_01.uk",    0x00000, 0x8000, 0xe1993f91 )
  1866.     ROM_LOAD_ODD ( "12c_05.uk",    0x00000, 0x8000, 0xc9761c78 )
  1867.     ROM_LOAD_EVEN( "13a_02.uk",    0x10000, 0x8000, 0xf6169c4b )
  1868.     ROM_LOAD_ODD ( "13c_06.uk",    0x10000, 0x8000, 0xaf58c548 )
  1869.     ROM_LOAD_EVEN( "14a_03.bin",   0x20000, 0x8000, 0x8cefb25f )
  1870.     ROM_LOAD_ODD ( "14c_07.bin",   0x20000, 0x8000, 0xd50b82cb )
  1871.     ROM_LOAD_EVEN( "15a_04.uk",    0x30000, 0x8000, 0x322423d0 )
  1872.     ROM_LOAD_ODD ( "15c_08.uk",    0x30000, 0x8000, 0xeb656266 )
  1873.  
  1874.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1875.     ROM_LOAD(      "09c_snd.bin",  0x00000, 0x4000, 0x26bf9636 )
  1876.  
  1877.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1878.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1879.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1880. ROM_END
  1881.  
  1882. ROM_START( konamigt )
  1883.     ROM_REGION( 0x40000, REGION_CPU1 )    /* 4 * 64k for code and rom */
  1884.     ROM_LOAD_EVEN( "c01.rom",      0x00000, 0x8000, 0x56245bfd )
  1885.     ROM_LOAD_ODD ( "c05.rom",      0x00000, 0x8000, 0x8d651f44 )
  1886.     ROM_LOAD_EVEN( "c02.rom",      0x10000, 0x8000, 0x3407b7cb )
  1887.     ROM_LOAD_ODD ( "c06.rom",      0x10000, 0x8000, 0x209942d4 )
  1888.     ROM_LOAD_EVEN( "b03.rom",      0x20000, 0x8000, 0xaef7df48 )
  1889.     ROM_LOAD_ODD ( "b07.rom",      0x20000, 0x8000, 0xe9bd6250 )
  1890.     ROM_LOAD_EVEN( "b04.rom",      0x30000, 0x8000, 0x94bd4bd7 )
  1891.     ROM_LOAD_ODD ( "b08.rom",      0x30000, 0x8000, 0xb7236567 )
  1892.  
  1893.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1894.     ROM_LOAD(       "b09.rom",      0x00000, 0x4000, 0x539d0c49 )
  1895.  
  1896.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1897.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1898.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1899. ROM_END
  1900.  
  1901. ROM_START( rf2 )
  1902.     ROM_REGION( 0xc0000, REGION_CPU1 )    /* 5 * 64k for code and rom */
  1903.     ROM_LOAD_EVEN( "400-a06.15l",  0x00000, 0x08000, 0xb99d8cff )
  1904.     ROM_LOAD_ODD ( "400-a04.10l",  0x00000, 0x08000, 0xd02c9552 )
  1905.     ROM_LOAD_EVEN( "561-a07.17l",  0x80000, 0x20000, 0xed6e7098 )
  1906.     ROM_LOAD_ODD ( "561-a05.12l",  0x80000, 0x20000, 0xdfe04425 )
  1907.  
  1908.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1909.     ROM_LOAD(      "400-e03.5l",   0x00000, 0x02000, 0xa5a8e57d )
  1910.  
  1911.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1912.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1913.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1914. ROM_END
  1915.  
  1916. ROM_START( twinbee )
  1917.     ROM_REGION( 0xc0000, REGION_CPU1 )    /* 5 * 64k for code and rom */
  1918.     ROM_LOAD_EVEN( "400-a06.15l",  0x00000, 0x08000, 0xb99d8cff )
  1919.     ROM_LOAD_ODD ( "400-a04.10l",  0x00000, 0x08000, 0xd02c9552 )
  1920.     ROM_LOAD_EVEN( "412-a07.17l",  0x80000, 0x20000, 0xd93c5499 )
  1921.     ROM_LOAD_ODD ( "412-a05.12l",  0x80000, 0x20000, 0x2b357069 )
  1922.  
  1923.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1924.     ROM_LOAD(      "400-e03.5l",   0x00000, 0x02000, 0xa5a8e57d )
  1925.  
  1926.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1927.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1928.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1929. ROM_END
  1930.  
  1931. ROM_START( gradius )
  1932.     ROM_REGION( 0xc0000, REGION_CPU1 )    /* 5 * 64k for code and rom */
  1933.     ROM_LOAD_EVEN( "400-a06.15l",  0x00000, 0x08000, 0xb99d8cff )
  1934.     ROM_LOAD_ODD ( "400-a04.10l",  0x00000, 0x08000, 0xd02c9552 )
  1935.     ROM_LOAD_EVEN( "456-a07.17l",  0x80000, 0x20000, 0x92df792c )
  1936.     ROM_LOAD_ODD ( "456-a05.12l",  0x80000, 0x20000, 0x5cafb263 )
  1937.  
  1938.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1939.     ROM_LOAD(      "400-e03.5l",   0x00000, 0x2000, 0xa5a8e57d )
  1940.  
  1941.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1942.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1943.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1944. ROM_END
  1945.  
  1946. ROM_START( gwarrior )
  1947.     ROM_REGION( 0xc0000, REGION_CPU1 )    /* 5 * 64k for code and rom */
  1948.     ROM_LOAD_EVEN( "400-a06.15l",  0x00000, 0x08000, 0xb99d8cff )
  1949.     ROM_LOAD_ODD ( "400-a04.10l",  0x00000, 0x08000, 0xd02c9552 )
  1950.     ROM_LOAD_EVEN( "578-a07.17l",  0x80000, 0x20000, 0x0aedacb5 )
  1951.     ROM_LOAD_ODD ( "578-a05.12l",  0x80000, 0x20000, 0x76240e2e )
  1952.  
  1953.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1954.     ROM_LOAD(      "400-e03.5l",   0x00000, 0x02000, 0xa5a8e57d )
  1955.  
  1956.     ROM_REGION( 0x0200,  REGION_SOUND1 )      /* 2x 256 byte for 0005289 wavetable data */
  1957.     ROM_LOAD(      "400-a01.fse",  0x00000, 0x0100, 0x5827b1e8 )
  1958.     ROM_LOAD(      "400-a02.fse",  0x00100, 0x0100, 0x2f44f970 )
  1959. ROM_END
  1960.  
  1961. ROM_START( salamand )
  1962.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for code */
  1963.     ROM_LOAD_EVEN( "18b.bin",      0x00000, 0x10000, 0xa42297f9 )
  1964.     ROM_LOAD_ODD ( "18c.bin",      0x00000, 0x10000, 0xf9130b0a )
  1965.     ROM_LOAD_EVEN( "17b.bin",      0x40000, 0x20000, 0xe5caf6e6 )
  1966.     ROM_LOAD_ODD ( "17c.bin",      0x40000, 0x20000, 0xc2f567ea )
  1967.  
  1968.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1969.     ROM_LOAD(      "11j.bin",      0x00000, 0x08000, 0x5020972c )
  1970.  
  1971.     ROM_REGION( 0x04000, REGION_SOUND1 )    /* VLM5030 data? */
  1972.     ROM_LOAD(      "8g.bin",       0x00000, 0x04000, 0xf9ac6b82 )
  1973.  
  1974.     ROM_REGION( 0x20000, REGION_SOUND2 )    /* 007232 data */
  1975.     ROM_LOAD(      "10a.bin",      0x00000, 0x20000, 0x09fe0632 )
  1976. ROM_END
  1977.  
  1978. ROM_START( lifefrce )
  1979.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for code */
  1980.     ROM_LOAD_EVEN( "587-k02.bin",  0x00000, 0x10000, 0x4a44da18 )
  1981.     ROM_LOAD_ODD ( "587-k05.bin",  0x00000, 0x10000, 0x2f8c1cbd )
  1982.     ROM_LOAD_EVEN( "17b.bin",      0x40000, 0x20000, 0xe5caf6e6 )
  1983.     ROM_LOAD_ODD ( "17c.bin",      0x40000, 0x20000, 0xc2f567ea )
  1984.  
  1985.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  1986.     ROM_LOAD(      "587-k09.bin",  0x00000, 0x08000, 0x2255fe8c )
  1987.  
  1988.     ROM_REGION( 0x04000, REGION_SOUND1 )    /* VLM5030 data? */
  1989.     ROM_LOAD(      "587-k08.bin",  0x00000, 0x04000, 0x7f0e9b41 )
  1990.  
  1991.     ROM_REGION( 0x20000, REGION_SOUND2 )    /* 007232 data */
  1992.     ROM_LOAD(      "10a.bin",      0x00000, 0x20000, 0x09fe0632 )
  1993. ROM_END
  1994.  
  1995. ROM_START( lifefrcj )
  1996.     ROM_REGION( 0x80000, REGION_CPU1 )    /* 64k for code */
  1997.     ROM_LOAD_EVEN( "587-n02.bin",  0x00000, 0x10000, 0x235dba71 )
  1998.     ROM_LOAD_ODD ( "587-n05.bin",  0x00000, 0x10000, 0x054e569f )
  1999.     ROM_LOAD_EVEN( "587-n03.bin",  0x40000, 0x20000, 0x9041f850 )
  2000.     ROM_LOAD_ODD ( "587-n06.bin",  0x40000, 0x20000, 0xfba8b6aa )
  2001.  
  2002.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound */
  2003.     ROM_LOAD(      "587-n09.bin",  0x00000, 0x08000, 0xe8496150 )
  2004.  
  2005.     ROM_REGION( 0x04000, REGION_SOUND1 )    /* VLM5030 data? */
  2006.     ROM_LOAD(      "587-k08.bin",  0x00000, 0x04000, 0x7f0e9b41 )
  2007.  
  2008.     ROM_REGION( 0x20000, REGION_SOUND2 )    /* 007232 data */
  2009.     ROM_LOAD(      "10a.bin",      0x00000, 0x20000, 0x09fe0632 )
  2010. ROM_END
  2011.  
  2012.  
  2013.  
  2014. GAME( 1985, nemesis,  0,        nemesis,       nemesis,  0, ROT0, "Konami", "Nemesis (hacked?)" )
  2015. GAME( 1985, nemesuk,  nemesis,  nemesis,       nemesuk,  0, ROT0, "Konami", "Nemesis (World?)" )
  2016. GAME( 1985, konamigt, 0,        konamigt,      konamigt, 0, ROT0, "Konami", "Konami GT" )
  2017. GAME( 1985, rf2,      konamigt, rf2_gx400,     rf2,      0, ROT0, "Konami", "Konami RF2 - Red Fighter" )
  2018. GAME( 1985, twinbee,  0,        twinbee_gx400, twinbee,  0, ORIENTATION_SWAP_XY, "Konami", "TwinBee" )
  2019. GAME( 1985, gradius,  nemesis,  gx400,         gradius,  0, ROT0, "Konami", "Gradius" )
  2020. GAME( 1985, gwarrior, 0,        gx400,         gwarrior, 0, ROT0, "Konami", "Galactic Warriors" )
  2021. GAME( 1986, salamand, 0,        salamand,      salamand, 0, ROT0, "Konami", "Salamander" )
  2022. GAME( 1986, lifefrce, salamand, salamand,      salamand, 0, ROT0, "Konami", "Lifeforce (US)" )
  2023. GAME( 1986, lifefrcj, salamand, salamand,      lifefrcj, 0, ROT0, "Konami", "Lifeforce (Japan)" )
  2024.